﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Aulac.Rsc.Bss;
using Aulac.Rsc.Bss.Tags;
using Aulac.Global.Enums; using Aulac.Global.Data; using Aulac.Global.Common; using Aulac.Global.Xml;
using Aulac.Client.Controls;
using Aulac.Client.Global.Interface;
using Aulac.UtilityTools;
using Aulac.Global.Exceptions;

namespace Aulac.Client.Controls.Forms.Bss
{
    public partial class FormEmsDataVchBase : Aulac.Client.Controls.Forms.BaseFormDataVch
    {
        protected Aulac.Rsc.Bss.VchTypes mVchType = Aulac.Rsc.Bss.VchTypes.None;
        protected string mVchName = "";

        public FormEmsDataVchBase()
        {
            InitializeComponent();
        }

        #region Ovrride Methods
       
        protected override bool OnBeginShowDetailVoucher()
        {            
            if (isEmpty(FieldVchPrkID))
                throw new AulacException(this, "OnBeginShowDetailVoucher", "Not set value for FieldVchPrkID");

            //mVoucherID = grdInfo.GetValue(grdInfo.SelectedGridRowView, FieldVchPrkID);
            //if (mVchType == Aulac.Rsc.Bss.VchTypes.None)
            //    mVchType = (Aulac.Rsc.Bss.VchTypes)ValueHelper.ChangeType(grdInfo.GetValue(grdInfo.SelectedGridRowView, tagGeneral.VchTypeID), typeof(Aulac.Rsc.Bss.VchTypes));

            if (tabControlBase.SelectedTab == tabPgList)
                tabControlBase.SelectedTab = tabPgDetial;

            return base.OnBeginShowDetailVoucher();
        }
        
        protected override void OnEndDelVoucher()
        {
            OnClearValueControls();
            grdInfo.RemoveGridDataRow(grdInfo.SelectedGridRowView);
            OnNextVoucher();
        }
        #endregion

        #region IDataRequest Members

        //public System.Xml.XmlDataDocument CreateXmlDocument(string pStrVerb, string pStrNoun)
        //{
        //    return DataRequest.CreateXmlDocument(pStrVerb, pStrNoun);
        //}

        //public System.Xml.XmlDataDocument ProcessRequest(System.Xml.XmlDataDocument xmlDoc)
        //{
        //    return DataRequest.ProcessRequest(xmlDoc);
        //}

        #endregion

    }
}
